package com.rsk.dao;


import java.io.Serializable;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.rsk.entity.SysAuthority;

@Repository
public interface SysAuthorityRepository extends JpaRepository<SysAuthority, Long>,JpaSpecificationExecutor<SysAuthority>,Serializable {
	
	@Modifying
	@Query(value = "update sys_authoritys set auth_name = ?2, auth_code = ?2, operator_user =?4, operator_time = NOW() where id =?1", nativeQuery = true)
	public int updateSysAuthority(Long id, String authName, String authCode, Long operatorUser);
	
	@Modifying
	@Query(value = "update sys_authoritys set is_del = 1, operator_user =?2, operator_time = NOW()where id =?1", nativeQuery = true)
	public int delSysAuthority(Long id, Long operatorUser);
	
}
 